<div class="table-responsive">
    <table class="table table-condensed">
        <thead class="wastebook-head">
        <tr class="calendar-head">
            <th>时间</th>
            <th>客户手机</th>
            <th>任务描述</th>
            <th>任务跟踪</th>
            <th>地址</th>
            <th>发布者</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="calendar_list">
        <?php foreach($data['query'] as $k){?>
            <?php if ($k['start'] == 0){?>
            <tr class="wastebook-lists">
                <td class="calendar-time"><?php echo $k['time']?></td>
                <td class="calendar-mobile"><?php echo $k['mobile']?></td>
                <td class="calendar-text"><?php echo $k['text']?></td>
                <td class="calendar-up">
                    <?php $id = $k['entry']; if ($k['num'] != 0){?>
                        <!-- Button trigger modal -->
                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#calendar_list_<?php echo $id ?>" onclick='calendar_body_list(<?php echo $id ?>)'>
                            查看进度 <span class="badge"><?php echo $k['num'] ?></span>
                        </button>
                        <!-- Modal -->
                        <div class="modal fade modal-primary" id="calendar_list_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                            <div class="modal-dialog modal-lg" role="document">
                                <div class="modal-content table-responsive">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title" id="myModalLabel">任务跟踪列表</h4>
                                    </div>
                                    <div class="modal-body">
                                        <table class="table table-condensed table-bordered">
                                            <thead class="calendar-head">
                                            <tr>
                                                <td>次数</td>
                                                <td>时间</td>
                                                <td>内容</td>
                                                <td>跟踪人</td>
                                            </tr>
                                            </thead>
                                            <tbody id='calendar_body_list_<?php echo $id ?>' class="calendar-lists">
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php } else{ echo "N/A";}?>
                </td>
                <td class="calendar-addr"><?php echo $k['addr']?></td>
                <td class="calendar-name"><?php echo $k['name']?></td>
                <td class="calendar-set">
                    <button type="button" class="btn btn-success btn-xs" onclick='calendar_set("ok",<?php echo $id ?>)'> 确定</button>

                    <!-- Calendar for set update modal -->
                    <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#calendar_set_<?php echo $id ?>"> 更新</button>

                    <button type="button" class="btn btn-danger  btn-xs" onclick='calendar_set("del",<?php echo $id ?>)'> 删除</button>

                    <!-- Calendar for set update Modal -->
                    <div class="modal fade modal-success" id="calendar_set_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel">更新任务</h4>
                                </div>
                                <div class="modal-body">
                                    <input type="text" class="form-control" placeholder="填写更新内容" id="calendar_text_<?php echo $id ?>" style="height: 100px">
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <button type="button" class="btn btn-primary" onclick='calendar_set("set",<?php echo $id ?>)'>保存</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
        <?php /*endstart*/} /*endforeach*/ }?>
        </tbody>
    </table>
</div>